import {request} from '@umijs/max';
import * as API from "@/services";


/** 用户标签 分页检索请求 */
export async function queryUserTags(params: API.UserTagPageQueryParams): Promise<API.RespPageResult<API.UserTag>> {
  return request('/api/v1/user-tag', {
    params,
  });
}

/** 用户标签 详情请求 */
export async function queryUserTag(bizId: API.EntityId): Promise<API.RespResult<API.UserTag>> {
  return request(`/api/v1/user-tag/${bizId}`);
}

/** 用户标签 创建请求 */
export async function createUserTag(entity: API.UserTag_Create): Promise<API.RespResult<any>> {
  return request(`/api/v1/user-tag`, {
    method: 'POST',
    data: entity,
  });
}

/** 用户标签 修改请求 */
export async function modifyUserTag(entity: API.UserTag_Modify): Promise<API.RespResult<any>> {
  return request(`/api/v1/user-tag/${entity.id}`, {
    method: 'PUT',
    data: entity,
  });
}

/** 用户标签 修改(部分)请求 */
export async function patchUserTag(entity: API.UserTag_Patch): Promise<API.RespResult<any>> {
  return request(`/api/v1/user-tag/${entity.id}`, {
    method: 'PATCH',
    data: entity,
  });
}

/** 用户标签 删除请求 */
export async function deleteUserTag(bizId: API.EntityId): Promise<API.RespResult<any>> {
  return request(`/api/v1/user-tag/${bizId}`, {
    method: 'DELETE',
  });
}

/** 用户标签 批量删除请求 */
export async function deleteUserTags(bizIds: API.EntityId[]): Promise<API.RespResult<any>> {
  return request(`/api/v1/user-tag`, {
    method: 'DELETE',
    data: {
      ids: bizIds,
    },
  });
}
